<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="weather">
    <button id="btn">提交</button>
    <script>
        var weather = document.getElementById("weather");
        var btn = document.getElementById("btn");
        btn.onclick = function () {
            weather.value == "下雨了"?window.alert("收衣服"):window.alert("不收衣服");
        }
    </script>
</body>
</html>